<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="next" href="Castling.CharToken.html">
<link rel="Up" href="Castling.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Castling" rel="Chapter" href="Castling.html">
<link title="Generated" rel="Chapter" href="Generated.html"><title>Castling.ParserGenerator</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="Castling.html">Up</a>
&nbsp;<a href="Castling.CharToken.html">Next</a>
</div>
<center><h1>Functor <a href="type_Castling.ParserGenerator.html">Castling.ParserGenerator</a></h1></center>
<br>
<pre><span class="keyword">module</span> ParserGenerator: <div class="sig_block"><code class="code">functor (</code><code class="code">Token</code><code class="code"> : </code><code class="type"><a href="Castling.TokenType.html">TokenType</a></code><code class="code">) -&gt; </code><code class="code">sig</code> <a href="Castling.ParserGenerator.html">..</a> <code class="code">end</code></div></pre>Parser generator.<br>
<table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%">
<code>Token</code></td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Castling.TokenType.html">TokenType</a></code>
</table>
</td>
</tr>
</table>
<hr width="100%">
<pre><span class="keyword">module</span> <a href="Castling.ParserGenerator.TokenSet.html">TokenSet</a>: <code class="code">sig</code> <a href="Castling.ParserGenerator.TokenSet.html">..</a> <code class="code">end</code></pre><div class="info">
Instance of Set module with token type.
</div>
<pre><span class="keyword">val</span> <a name="VALdebug"></a>debug : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, output internal states. 
	The initial setting for <code class="code">debug</code> is <code class="code">false</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALruntime_debug"></a>runtime_debug : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, put printing state-numbers in the parser.
	The initial setting for <code class="code">runtime_debug</code> is <code class="code">false</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALerror_handling"></a>error_handling : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, enable automatic error recovering.
	The initial setting for <code class="code">error_handling</code> is <code class="code">true</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALpolymorphic_variants"></a>polymorphic_variants : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, put the abstract syntax tree into polymorphic variant types.
	The initial setting for <code class="code">polymorphic_variants</code> is <code class="code">false</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALranged_position"></a>ranged_position : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, take positions as tuple having first and last positions.
	The initial setting for <code class="code">ranged_position</code> is <code class="code">false</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALpretty_printer"></a>pretty_printer : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, generating pretty-printer for parsed values.
	The initial setting for <code class="code">pretty_printer</code> is <code class="code">false</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALerror_printer"></a>error_printer : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, generating pretty-printer for errors.
	The initial setting for <code class="code">error_printer</code> is <code class="code">false</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALconflicting_error"></a>conflicting_error : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, raise ParserGeneratingError if it found conflicting.
	The initial setting for <code class="code">conflicting_error</code> is <code class="code">true</code>.<br>
</div>
<br><code><span class="keyword">type</span> <a name="TYPEtree"></a><code class="type"></code>tree = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Leaf</span> <span class="keyword">of</span> <code class="type">string * <a href="Castling.ParserGenerator.TokenSet.html#TYPEt">TokenSet.t</a></code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">LeafEpsilon</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">LeafPosition</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">NodePosition</span> <span class="keyword">of</span> <code class="type"><a href="Castling.ParserGenerator.html#TYPEtree">tree</a></code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">NodePositionWith</span> <span class="keyword">of</span> <code class="type"><a href="Castling.ParserGenerator.html#TYPEtree">tree</a></code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">NodeSkip</span> <span class="keyword">of</span> <code class="type"><a href="Castling.ParserGenerator.html#TYPEtree">tree</a></code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">NodeSeq</span> <span class="keyword">of</span> <code class="type"><a href="Castling.ParserGenerator.html#TYPEtree">tree</a> list</code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">NodeIndSeq</span> <span class="keyword">of</span> <code class="type">string * <a href="Castling.ParserGenerator.html#TYPEtree">tree</a> list</code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">NodeOr</span> <span class="keyword">of</span> <code class="type">string * (string * <a href="Castling.ParserGenerator.html#TYPEtree">tree</a> lazy_t) list</code></code></td>

</tr></table>

<div class="info">
Syntax rule representation.<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPEparser"></a><code class="type"></code>parser = <code class="type"><a href="Castling.ParserGenerator.html#TYPEtree">tree</a> lazy_t</code> </pre>
<div class="info">
Syntax rule type.<br>
</div>

<pre><span class="keyword">val</span> <a name="VAL(!!)"></a>(!!) : <code class="type">'a Lazy.t -> 'a</code></pre><div class="info">
Abbreviation of Lazy.force.
	It makes eager to write recursive rules.
	<pre><code class="code">let rec rule1 = lazy !! (...use other rules...) and rule2 = lazy !! (...) and ...</code></pre><br>
</div>
<pre><span class="keyword">val</span> <a name="VALelement"></a>element : <code class="type">?name:string -><br>       <a href="Castling.ParserGenerator.TokenSet.html#TYPEelt">TokenSet.elt</a> -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
One token rule.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALone_of_elements"></a>one_of_elements : <code class="type">?name:string -><br>       <a href="Castling.ParserGenerator.TokenSet.html#TYPEelt">TokenSet.elt</a> list -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Selecting one of tokens rule.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALone_of"></a>one_of : <code class="type">?name:string -><br>       (string * <a href="Castling.ParserGenerator.html#TYPEparser">parser</a>) list -><br>       <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Selecting one of rules, mapped to variant.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALerror"></a>error : <code class="type">string -> string</code></pre><div class="info">
Mark name as error case for <code class="code">one_of</code>.
	The case used this magic name makes <code class="code">None</code> and supresses entering on error handling.
	<pre><code class="code">one_of "type" ["case1", ...; "case2", ...; error "error_case", ...]</code></pre><br>
</div>
<pre><span class="keyword">val</span> <a name="VALsequence_of"></a>sequence_of : <code class="type">?name:string -><br>       <a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Separate sequence of rules, mapped to tuple.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALskip"></a>skip : <code class="type"><a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
The rule be parsed, but not memorized.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALposition_with"></a>position_with : <code class="type"><a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Memorized position and syntax tree.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALposition_of"></a>position_of : <code class="type"><a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Memorized position only.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALposition"></a>position : <code class="type"><a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Memorized current position.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALepsilon"></a>epsilon : <code class="type"><a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Empty rule.<br>
</div>
<pre><span class="keyword">val</span> <a name="VAL(>>)"></a>(&gt;&gt;) : <code class="type"><a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -><br>       <a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a></code></pre><div class="info">
Concatenate two rules.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALpp_generate"></a>pp_generate : <code class="type">Format.formatter -><br>       ?ast_module:string -><br>       ?parser_module:string -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -> unit</code></pre><div class="info">
Generate your parser.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALgenerate"></a>generate : <code class="type">?ast_module:string -><br>       ?parser_module:string -> <a href="Castling.ParserGenerator.html#TYPEparser">parser</a> -> unit</code></pre><div class="info">
Generate and output your parser.<br>
</div>
</body></html>